<template>
	<view>
		<view>
			<!-- 自定义导航栏 -->
			<view class="navBarBox">
				<!-- 状态栏占位 -->
				<view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
				<!-- 真正的导航栏内容 -->
				<view class="navBar">
					<view class="goback">
						<view @click="goBack" class="goicon" style="background:url(../../../static/goback.png);background-size:contain;background-repeat: no-repeat;">
						</view>
					</view>
					<view class="title">学校管理员绑定</view>
					<view class="right">
					</view>
				</view>
			</view>
			<view class="black-strip"></view>
			
			<view class="region1">
				<view class="">管理员ID</view>
				<input type="text" class="inp" v-model="schAdminConfirm"/>
			</view>
			<button @click="goRegConfirm" class="ok" hover-class="button-hover">下一步</button>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				//学校管理员
				schAdminConfirm:'',
				// 状态栏高度
				statusBarHeight: 0,
				// 导航栏高度
				navBarHeight: 82 + 11,
			}
		},
		//第一次加载时调用
		created() {
			//获取手机状态栏高度
			this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
		},
		methods: {
			goBack() {
				// 此处是写返回页面的方法、

				uni.navigateBack({
					delta: 1 //返回只上一级页面
				});
			},
			//进入学校管理员信息确认页
			goRegConfirm() {
				this.$myRequest({
					url:'/teacher/bindManager/'+this.schAdminConfirm+'',
					success:(res)=>{
						console.log(res)
						if(res.data.code==0){
							uni.setStorageSync('schAdminConfirm', this.schAdminConfirm);
							uni.setStorageSync('schAdminConfirmData', res.data.data);
							uni.navigateTo({
								url: './schAdminConfirm'
							})
							}else{
							uni.showToast(
							{
								title:'Id错误',
								duration: 1000
							})
						}
					}
				})
			}
		}
	}
</script>

<style scoped>
	.navBarBox .navBar {
		padding: 3rpx 50rpx;
		padding-bottom: 8rpx;
		display: flex;
		justify-content: space-between;

		line-height: 93rpx;
		font-size: 40rpx;
	}
	.black-strip {
		height: 20rpx;
		background-color: #fafafa;
	}
	.goback {
		flex: 1;
		height: 100%;
	}

	.goicon {
		width: 30rpx;
		height: 30rpx;
		background-color: #00BEA9;
		margin-top: 30rpx;
	}

	.title {
		flex: 3;
		height: 100%;

	}

	.right {
		flex: 1;
	}

	.region1 {
		margin-left: 15rpx;
		border-bottom: #8F8F94 solid 1px;
	}

	.inp {
		padding-top: 20rpx;
		color: #C8C7CC;
	}

	.ok {
		margin-top: 290rpx;
		margin-bottom: 50rpx;
		width: 230rpx;
		height: 70rpx;
		line-height: 70rpx;
		font-size: 30rpx;
		color: #fff;
		background-color: #2FB3FE;
	}

	.button-hover {
		color: #fff;
		background-color: #118ace;
	}
</style>
